package command.gew;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import command.ICommand;

public class AdicionaRespondenteQuestionarioCommand implements ICommand{

	public String execute(HttpServletRequest request) throws ServletException,IOException {
		String[] resp = request.getParameterValues("resp");
		ArrayList<Integer> respondentes = new ArrayList<Integer>();
		for(int i = 0; i < resp.length ; i++){
			respondentes.add(Integer.parseInt(resp[i]));
		}
		HttpSession session = request.getSession(); 
		session.setAttribute("respondentes",respondentes);
		return "controller.do?acao=criarQuestionario";
	}
}
